﻿#include "common.h"
#include <cvt/wstring>
#include <codecvt>
#include <gl/glut.h>


std::string common::wstr_to_str(std::wstring ws)
{
    std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> convert;
    return convert.to_bytes(ws.c_str());
}

void common::renderBitmapString(float x, float y, float z, void *font, char *string) 
{
	char *c;
	glRasterPos3f(x, y,z);
	for (c=string; *c != '\0'; c++) 
		glutBitmapCharacter(font, *c);
}